package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-04-22
 * Time: 10:59
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        //System.out.println(root.val);
        System.out.println("前序遍历：");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("中序遍历：");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("后序遍历：");
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("节点个数为：");
        System.out.println(binaryTree.size1(root));
        System.out.println(binaryTree.size2(root));
        System.out.println("叶子节点个数为：");
        binaryTree.getLeafNodeCount1(root);
        System.out.println(BinaryTree.usedSize);
        System.out.println(binaryTree.getLeafNodeCount2(root));
    }
}
